import resolve from '@rollup/plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
// {
//   ignore: ['conditional-runtime-dependency'],
// }
let plugins = [resolve(), commonjs()];
// 生产环境
if (process.env.NODE_ENV == 'production') {
  plugins.push(terser());
}

export default {
  input: `index.js`,
  output: {
    file: `../index2.js`,
    format: 'commonjs',
  },
  context: 'node',
  plugins,
};
